package com.example.dao;

import com.example.entity.NxScoreInfo;
import com.example.vo.NxScoreInfoVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface NxScoreInfoDao extends Mapper<NxScoreInfo> {
    List<NxScoreInfoVo> findByName(@Param("name") String name);

    List<NxScoreInfoVo> findPage(@Param("name") String name, @Param("userId") Long userId, @Param("level") Integer level);

    @Select("select * from nx_score_info where code = #{code} and userId = #{userId} and level = #{level}")
    NxScoreInfo findByCode(@Param("code") String code, @Param("userId") Long userId, @Param("level") Integer level);
}
